home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / misc.554 < prev    next >
Text File  |  1992-02-06  |  2KB  |  55 lines

  1. {\rtf0\ansi{\fonttbl\f0\froman Times;\f1\fmodern Courier;}
  2. \paperw11760
  3. \paperh7200
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ul0\fs28\fc0 NextAnswers floating point number format\
  8. \
  9. Q:  How are NeXT's floating-point numbers stored in memory?\
  10. \
  11. A:  Floating-point numbers are stored in IEEE binary format, as specified in \
  12. ANSI/IEEE Std 754-1985.   There are two different precisions used for storage.\
  13. \
  14. NeXT data storage in general is "big endian", meaning that the most significant\
  15. bytes of an integer are stored in lower memory, and the LSB is at the high-memory\
  16. end of the int.\
  17. \
  18. The single-precision floating-point format, corresponding to type "float" in C, occupies 4 bytes as follows:\
  19. \
  20. Bit  31 (high bit of MSB): Sign bit\
  21. \
  22. Bits 23 - 30            8-bit exponent, in "excess 127" format (a bias of 127\
  23.                         is added to the twos-complement exponent value).\
  24. \
  25. Bits 0 - 22            23-bit significand fraction, left-justified in storage. The\
  26.                         integer part of the significand is not stored.  If the\
  27.                         number is 0 (biased exponent and fraction are both 0)\
  28.                         or denormalized (biased exponent field is 0, but fraction\
  29.                         is not), the integer part is understood to be 0.  Otherwise\
  30.                         it is understood to be 1.\
  31. \
  32. \
  33. The double-precision floating-point format, type "double" in C, occupies 8 bytes:\
  34. \
  35. Bit 63:                Sign bit\
  36. \
  37. Bits 52 - 62            11-bit exponent, in "excess 1023" format.\
  38. \
  39. Bits 0 - 51            52-bit significand fraction.\
  40. \
  41. \
  42. There is also an extended-precision format, which is not used for data storage.\
  43. \
  44. QA 
  45. \pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\fc0 554
  46. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 \
  47.  
  48. \gray666 \
  49.  
  50. Valid for 1.0 \
  51. Not checked yet for 2.0\
  52. \
  53.  
  54.  
  55.